package com.example.test_20210901;

import org.apache.ibatis.builder.BuilderException;

import java.util.HashSet;
import java.util.Set;

/**
 * @program: demo
 * @description: 测试
 * @author: liulei
 * @create: 2021-09-01 10:13
 **/
public class Test {

    public static void main(String[] args) {
        Set<String> collect = new HashSet<>();
        collect.add("2");
        collect.add("1");
        collect.add("10");
        if(collect.size() == 0 || collect.size() == 1){
            if(collect.contains("2") || collect.contains("10")){
                System.out.println("zhuren.........");
            }else{
                System.out.println("yb.........");
            }
        }else{
            boolean flagZr = false;
            boolean flagYb = false;
            for (String str : collect) {
                if("2".equals(str) || "10".equals(str)){
                    flagZr = true;
                    break;
                }
            }
            for (String str : collect) {
                if(!"2".equals(str) && !"10".equals(str)){
                    flagYb = true;
                    break;
                }
            }
            if(flagZr && flagYb){
                throw new BuilderException("人员选择明细有误,(主任\\副主任)和一般员工不能同时选择！");
            }
            if(flagZr){
                System.out.println("zhuren.........");
            }
            if(flagYb){
                System.out.println("yb.........");
            }
        }
    }
}
